<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/bootstrap/dist/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/resource/jquery/dist/jquery.min.js"></script>
    <script src="/resource/js/main.js"></script>
    <script type="text/javascript" src="/resource/js/common.js"></script>

    <style>

        body,div,ul{margin:0px;padding:0px;}
        #container{
            width:1200px;
            margin:0 auto;
        }
        #Header{
            margin-bottom: 0px;
        }
        #Carousel{
            margin-top: 0px;
        }
        #Content{
            margin-top:20px;
        }
        #Footer{
            margin-top: 20px;
            background: yellow;
        }
        .clear{
            clear: both;
        }
        #tzgg{
            width:40%;
        }

        li{
            　　display:block;overflow:hidden;word-break:keep-all;white-space:nowrap;text-overflow:ellipsis;
        }

    </style>
    <script type="text/javascript">

        //通知公告
        $(function () {
            //ajax 获取首页内容
            //nav
            /*获取通知公告*/
            initNav();
            $.ajax("/news/getNewsJsonData.do?moduleId=3&pageNumber=1&pageSize=6", {
                success: function (json) {
                    var data = json.data;
                    for (var i = 0; i < data.length; i++) {
                        //<li ><a href="/news/read.do?id=${news.id}">${news.title}</a></li>
                        var $data = $("<li><a href='/news/read.do?id=" + data[i].id + "'>" + data[i].title + "</a></li>");
                        $("#tzgg-body").append($data);
                    }
                }
            });
            /*获取母校动态*/
            $.ajax("/news/getNewsJsonData.do?moduleId=1&pageNumber=1&pageSize=6",{
                success:function (json) {
                    var data = json.data;
                    for (var i=0;i<data.length;i++){
                        addMedia($("#mxdt-body"),data[i]);
                    }
                }
            });
            /*获取校友动态*/
            $.ajax("/news/getNewsJsonData.do?moduleId=2&pageNumber=1&pageSize=6",{
                success:function (json) {
                    var data = json.data;
                    for (var i=0;i<data.length;i++){
                        addMedia($('#xydt-body'), data[i]);
                    }
                }
            })

        })

    </script>

</head>
<body style="background-image:url('${pageContext.request.contextPath}/resource/img/bgimg.jpg') ">
<div id="container">
    <jsp:include page="Head.jsp" />

<%--    <div style="text-align:center;clear:both">
        <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
        <script src="/follow.js" type="text/javascript"></script>
    </div>--%>
    <div id="Content" class="row" >
        <div id="content-left" style="float: left;width: 30%">
            <div id="tzgg" style="float: left;width: 100%;padding-right: 10px">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h4 class="panel-title" style="display: inline">${module3Name}</h4>
                        <button class="btn btn-info btn-xs" style="float:right;margin-right: 10px" onclick="toAddress('/module/selectModule.do?id=3')">更多</button>
                    </div>
                    <div id="tzgg-body" class="panel-body" >
                        <div style="padding-left: 20px;margin-right: 0">
                            <ul>
                                <c:forEach items="${tzggList}" var="news">
                                    <li ><a href="/news/read.do?id=${news.id}">${news.title}</a></li>
                                </c:forEach>
                            </ul>
                        </div>


                    </div>
                </div>
            </div>
        </div>
        <div id="content-main" style="float: left;width: 70%">
            <div  style="float: left;width: 100%;padding-left: 10px">

            </div>

            <%--母校动态--%>
            <div id="mxdt" style="float: left;width: 100%;padding-left: 10px">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h4 class="panel-title" style="display: inline">${module1Name}</h4>
                        <button class="btn btn-info btn-xs" style="float:right;margin-right: 10px" onclick="toAddress('/module/selectModule.do?id=1')">更多</button>
                    </div>
                    <div id="mxdt-body" class="panel-body">
                        <c:forEach items="${mxdtList}" var="news">
                            <div class="media">
                                <div class="media-body">
                                    <h4 class="media-heading">${news.title}</h4>
                                    ${news.intrduce}
                                </div>
                                <div class="media-right">
                                    <a href="/news/read.do?id=${news.id}">
                                        <img class="media-object" style="width: 64px;height:64px;" src="${news.thumbnailPath}" >
                                    </a>
                                </div>
                            </div>
                        </c:forEach>


                    </div>
                </div>
                <div class="panel panel-primary">
                    <!--校友动态模块-->
                    <div class="panel-heading">
                        <h4 class="panel-title" style="display: inline">${module2Name}</h4>
                        <button class="btn btn-info btn-xs" style="float:right;margin-right: 10px" onclick="toAddress('/module/selectModule.do?id=2')">更多</button>
                    </div>
                    <div id="xydt-body" class="panel-body">
                        <c:forEach items="${xydtList}" var="news">
                            <div class="media">
                                <div class="media-body">
                                    <h4 class="media-heading">${news.title}</h4>
                                        ${news.intrduce}
                                </div>
                                <div class="media-right">
                                    <a href="/news/read.do?id=${news.id}">
                                        <img class="media-object" style="height:64px;width: 64px;" src="${news.thumbnailPath}" >
                                    </a>
                                </div>
                            </div>
                        </c:forEach>

                    </div>
                </div>
            </div>
        </div>



    </div>
</div>
<div id="Footer" class="row">
    <jsp:include page="footer.jsp"/>
</div>

<script src="${pageContext.request.contextPath}/resource/bootstrap/dist/js/bootstrap.min.js" ></script>
</body>
</html>
